package gatperdut.chato.core.interpreter.actions;

import gatperdut.chato.constants.CSConstantsCommandResult.CommandExecutionResult;
import gatperdut.chato.core.characters.BaseController;
import gatperdut.chato.core.interpreter.actions.generic.Action;
import gatperdut.chato.core.interpreter.grammar.comminfo.SkillsInfo;

public class SkillsAction extends Action {

    public SkillsAction( SkillsInfo info, BaseController entityController ) {
        super( info, entityController );
    }

    @Override
    public CommandExecutionResult perform() {
        checkForRunningCraft();

        String sb = getEntityController().getSkillsController().listKnownSkills();

        if ( sb.equals( "" ) ) {
            getEntityController().tx( "You have no skills." );
        }
        else {
            getEntityController().tx( sb );
        }

        return CommandExecutionResult.OK;
    }

    @Override
    public boolean interruptsCrafting() {
        return false;
    }

    @Override
    public SkillsInfo getInfo() {
        return (SkillsInfo) super.getInfo();
    }

}
